import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/homeIndex'
  },
  {
    path: '/homeIndex',
    name: 'HomeIndex',
    component: () => import(/* webpackChunkName: "homeindex" */ '../views/home/index.vue'),
    children: [
      {
        path: '/homeIndex/table',
        component: () => import(/* webpackChunkName: "table" */ '../views/home/page/table.vue'),
      },
      {
        path: '/homeIndex/form',
        component: () => import(/* webpackChunkName: "form" */ '../views/home/page/form.vue'),
      }
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import(/* webpackChunkName: "login" */ '../views/login/index.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
